import Vue from "vue";
import VueRouter from "vue-router";
import admin from "./admin";
import user from "./user"

Vue.use(VueRouter);

const routes = [

  {
    name: "login",
    path: "/",
    component: () => import("@/views/Login")
  },
  {
    name: "admin",
    path: "/admin",
    component: () => import("@/views/Admin"),
    children: [...admin]
  },
  {
    name: "user",
    path: "/user",
    component: () => import("@/views/User"),
    children: [...user]
  }
];

const router = new VueRouter({
  routes,
  mode: "history"
});

export default router;
